import { BaseResponse } from '@/api/model/baseResponse';
import { ContentTypeEnum } from '@/constants';
import { request } from '@/utils/request';

/**
 * 上传文件
 * @param data 文件数据
 * @returns 文件URL
 */
export function uploadFile(data: FormData) {
  return request.post<BaseResponse<{ data: string }>>({
    url: 'common/file/upload',
    data,
    headers: {
      'Content-Type': ContentTypeEnum.FormData,
    },
  });
}
